#ifndef READERWRITER_H
#define READERWRITER_H

#include <pthread.h>

namespace concurrent {

class ReaderWriter : private Uncopyable
{
public:
	ReaderWriter();
	~ReaderWriter();
	
	bool readLock();
	bool tryReadLock();
	bool writeLock();
	bool tryWriteLock();
	bool unlock();

	bool destroy();
private:
	pthread_rwlock_t _lock;
};

}

#endif /* READERWRITER_H */

